package studentproject.main.dao;



import studentproject.main.domain.Student;

import java.util.ArrayList;

public class StudentDao {
    public static ArrayList<Student> list = new ArrayList<>();

    public ArrayList<Student> find() {
        return list;
    }

    public boolean add(Student student) {
        list.add(student);
        return true;
    }

    public boolean update(int index,Student student) {
        list.set(index,student);
        return true;
    }

    public boolean delete(int index) {
        list.remove(index);
        return true;
    }

    public boolean getList() {
        if(list.size() == 0){
            return false;
        }else {
            return true;
        }
    }
}
